// FrogExtractFolderDialog.h : Declaration of the CFrogProgressDialog

#pragma once

#include <atlhost.h>
#include "FrogBaseDialog.h"
#include "resource.h"       // main symbols
#include <atlcrack.h>
#include "IReportProgess.h"

class CFrogProgressDialog: public CFrogBaseDialog<CFrogProgressDialog>
{
public:

	bool m_MarqueeProgressBar;

	CFrogProgressDialog(HICON hIcon, IReportProgess* parent);

	virtual ~CFrogProgressDialog();

	enum { IDD = IDD_DIALOG_PROGRESS };

	BEGIN_MSG_MAP(CFrogProgressDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		// FrogBaseDialog Inherited
		CHAIN_MSG_MAP(CFrogBaseDialog)
	END_MSG_MAP()

	// Handler prototypes:
	//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	
	void SetProgress(int progress)
	{
		if (!m_MarqueeProgressBar)
		{
			HWND hWndControl = GetDlgItem(IDC_PROGRESS);
			::SendMessage(hWndControl, PBM_SETPOS, progress, 0);
		}
	}
private:
	HANDLE m_hThreadProgress;
	IReportProgess* m_Parent;

	static DWORD WINAPI RunCommandThread(LPVOID lpParam);
};


